import { createRouter, createWebHistory } from 'vue-router'

const routes = [
  {
    meta: {
      title: "用户登录",
    },
    path: '/login',
    name: 'Login',
    component: ()=>import("../views/Login.vue"),
  },
  {
    meta: {
      title: "Uric运维平台",
    },
    path: '/uric',
    alias: '/', // 给当前路径起一个别名
    name: 'Base',
    component: ()=>import("../views/Base.vue"),
    children: [
      {
        meta: {
          title: "展示中心",
        },
        path: 'show_center', // url路径
        name: 'ShowCenter',  // 组件别名
        component: ()=> import("../views/ShowCenter.vue")  // 组件对象
      },
      {
        meta: {
          title: "主机管理",
        },
        path: 'host',
        name: 'Host',
        component: ()=>import("../views/Host.vue"),
      },
    ]
  },
]

const router = createRouter({
  history: createWebHistory(), // 路由显示模式
  routes  // 路由列表
});

export default router;